package t04;

public class ConvertEnglishNameFormat {
    public static void main(String[] args) {
        String[] names = {
                "oliver smith",
                "noah bush",
                "harry brown",
                "jack wood",
                "charlie nixon",
                "jacob Weber",
                "lily Sandall",
                "emily Goodwin",
                "sophia Eberhardt",
                "ella Parker"
        };
        for (String name : names) {
            String[] split = name.split(" ");
            String lastName = split[1].substring(0, 1).toUpperCase() + split[1].substring(1);
            String firstName = split[0].substring(0, 1).toUpperCase() + split[0].substring(1);
            name = lastName + ", " + firstName;
            System.out.println(name);
        }
    }
}
